import useRequest from '../hooks/useRequest';
function UserInfo() {
    const { data, loading } = useRequest('http://10.2.35.4/api/user.json', {})
    return loading ? <div>数据加载中...</div> : <div>
        <h1>{data.name}</h1>
        <h2>{data.age}</h2>
    </div>
}
function OrderList() {
    const { data, loading } = useRequest('http://10.2.35.4/api/order.json', [])
    return loading ? <div>数据加载中...</div> : <ul>
        {data.map(item => <li key={item.id}>{item.name}</li>)}
    </ul>
}
export { UserInfo, OrderList }
